<?php
namespace App\Listener\Order;

use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Event\Annotation\Listener;

/**
 * @Listener 
 */
class LevelUserListener implements ListenerInterface
{
    public function listen(): array
    {
        return [
            \App\Event\Order\StatusOkEvent::class,
        ];
    }
    
    // 等级赋予用户
    public function process($event)
    {
        $event->user->setLevel($event->level);
    }
}